home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1986 January & February
/
rerun-1986-01-02.d64
/
disk renamer 64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
60 lines
1 rem *********************
2 rem * disk name changer *
3 rem * by *
4 rem * bob dickow *
5 rem *********************
6 :
70 rem --initialize & display screen--
80 q$=chr$(34): ar$=chr$(95): bk$=chr$(20): de$="[157]-[157]": ch$=chr$(221)
90 bx$=" [213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]":by$=" [202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
100 dh$=chr$(166):forx=1to40:ln$=ln$+dh$:next:r$=chr$(13): disk=8
110 forx=1to16:sp$=sp$+chr$(160):bl$=bl$+"-":next
120 print"[147][158] ***disk name changer***"
130 print:print" "q$;ar$;q$" = abort the change or exit"
140 print" "q$"inst/del"q$" = delete a character"
150 print" hit "q$"return"q$" key to enter change.":print
160 println$
170 print" insert disk & hit ";q$;"return"q$" when ready"
180 cu=0: gosub 520
190 ifa$=ar$ then print"[147]":end
200 ifa$<>r$ thenprint"[145]";:goto170
210 open 15,8,15:print#15,"i0":gosub 570
220 rem --get disk name from bam--
230 b$="": open8,di,8,"#":print#15,"ua:";8;0;18;0:print#15,"b-p:";8;144
240 forx=1to20:get#8,a$:b$=b$+a$:next
250 close8: close 15
260 nm$=left$(b$,16):id$=right$(b$,2)
270 print"[145] current disk name: "nm$;",";id$:b$=""
280 print" type new disk name (16 chrs maximum): ":print bx$
290 print spc(11);ch$;bl$;ch$:printby$:print"[145][145]";spc(12);
300 cu=1:gosub520
310 ifa$=r$ and peek(211)<>28then print"-[157]";:goto 410
320 z=len(b$):ifa$=r$ then 410
330 if a$=bk$ and z=0 then300
340 ifa$=bk$andpeek(211)=28thenprint ch$"[157]";de$;:b$=left$(b$,z-1):goto300
350 ifa$=bk$then print"-[157]";de$;:b$=left$(b$,z-1):goto300
360 ifa$=ar$ then b$="":print:print"[145]aborted":goto 480
370 ifa$="[145]"ora$=""ora$=""ora$="[147]"ora$=""ora$="[157]"then300
380 ifz<16thenb$=b$+a$:cu=1:printa$;
390 z=len(b$):goto300
400 rem --write to disk routine--
410 open15,di,15:open 8,di,8,"#":forx=1to2:print#15,"b-p:"8;144
420 ifx=1thenprint#8,sp$;:next
430 print#8,b$;
440 print#15,"u2:"8;0;18;0:gosub 570
450 close8:close15
460 print:printspc(20);"[145][145][145][145][145][145]";b$;
470 printright$(sp$,16-len(b$));","id$;""
480 print:print spc(12)"continue? (y/n)[157][157][157][157]";:cu=1:gosub520
490 ifa$="y" or a$=r$ then poke 204,1:print:goto120
500 print:end
510 rem --input subroutine--
520 geta$:if cu then poke 204,0:poke 207,0
530 if cu and a$="" and peek(211)=28 then cu=0:poke204,1:print ch$"[157]";
540 if a$=""then 520
550 poke204,1:return
560 rem --error check subroutine--
570 input#15,e,e$,t,s
580 ife>=20thenprint:print"error#"e;""e$:close8:close 15:end
590 return